<span page-title ng-model="contentView">{{ 'Publish Content View:' | translate }} {{ contentView.name }}</span>

<h3 translate>Publish New Version</h3>

<p translate>
  A new version of {{ contentView.name }} will be created and promoted to the Library environment.
  It can be promoted to other environments from the Versions tab of this Content View.
</p>

<div bst-alert="warning" ng-show="contentView.errors['messages'].length > 0">
  <span translate>{{contentView.errors['messages'][0]}}</span>
  </div>

<header class="details-header">
  <h3 translate>Version Details</h3>
</header>

<div class="row">
  <div class="col-sm-5">
    <div bst-alert="info" ng-show="contentView.duplicate_repositories_to_publish.length > 0">
      <p translate>
        You have selected more than one component Content View Version with the same repository resulting in slower publishing:
      </p>
      <ul>
        <li ng-repeat="repository in contentView.duplicate_repositories_to_publish">
          {{ repository.name }}
          <ul>
            <li ng-repeat="content_view in repository.components" >{{ content_view.content_view_name }} {{ content_view.content_view_version}}</li>
          </ul>
        </li>
      </ul>
      <p translate>
		    Duplicate repositories between the selected Content View Versions will merge, resulting in a Composite Content View with all packages that exist among the duplicates.
      </p>
    </div>

    <form name="versionForm" role="form" novalidate>
      <div bst-form-group label="{{ 'Version' | translate }}">
        <span>{{ contentView['next_version'] }}</span>
      </div>

      <div bst-form-group label="{{ 'Description' | translate }}">
    <textarea id="description"
              name="description"
              ng-model="version.description"
              rows="10"
              tabindex="1">
    </textarea>
      </div>

      <div bst-form-buttons
           on-cancel="transitionTo('content-view.versions', {contentViewId: contentView.id})"
           on-save="publish(contentView)"
           working="working">
      </div>
    </form>
  </div>
</div>
